
********************************************************************************
*
* WHY GOVERNMENTS HAVE THEIR TROOPS TRAINED ABROAD:
* EVIDENCE FROM LATIN AMERICA
*
* By Adam Scharpf
*
* International Studies Quarterly
*
* June 2020
*
********************************************************************************
*
* Content:	Replication of Figure 10	
*
*			Steps:
*			1) Set working directory
*			2) Run do-file to replicate Figure 10 in the manuscript
*
********************************************************************************
*
* Packages: Before running this code, please make sure you have the following
*			.ado-files installed:
*
*			- SPMAP Package, Version 1.3.0
*					net install spmap
*
********************************************************************************

	version 15.1
	set more off

	clear all
  
 
 
********************************************************************************
*
* Setting working directory in macro
*
********************************************************************************

	*Insert path to folder containing dataset "data_figure10.dta" and "data_figure10coords" before running
	global path="..." //Example: "C:\Users\me\Desktop\Scharpf\"
	
	
********************************************************************************
*
* Replicating Figure 10
*
********************************************************************************

	*Loading Figure 10 dataset
	use "$path\data_figure10.dta"
		
	*Figure 10
	#delimit ;
		spmap 
		trainees
		using "$path\data_figure10coords.dta", id(id)
		clmethod(custom) fcolor(Reds) clbreaks(0 50 100 500 1000 2000 8600)
		ndfcolor(gs14)
		legtitle("Number of trained security personnel") 
		legend(symy(*1.5) symx(*1.5) size(*1.5)
		label(2 "[1,50]") label(3 "(50,100]") label(4 "(100,500]") label(5 "(500,1000]") 
		label(6 "(1000,2000]") label(7 "(2000,8600]")
		)
		ndlabel("[0]")
		;
	#delimit cr	
	graph export "$path\figure10.pdf", replace as(pdf)		
		

********************************************************************************		
********************************************************************************
	
	*Closing graph windows
	graph close _all 
	
	*Clearing data
	clear all	
	
	
	